<template>
  <div class="k-duty-box">
    <div class="k-title">
      <img class="k-title-bg" :src="tbg" alt="" srcset="" />
      <div class="k-title-text">{{ currectData.label }}</div>
    </div>
    <div class="k-resp-zone">
      <div class="k-resp-zone-item">
        <div class="k-zone-item-box k-reap-1">面积</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.area }}
        </div>
        <div class="k-zone-item-box k-reap-3">森林覆盖率</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.forestCoverage }}
        </div>
      </div>
      <div class="k-resp-zone-item">
        <div class="k-zone-item-box k-reap-1">林木覆盖率</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.treeCoverage }}
        </div>
        <div class="k-zone-item-box k-reap-3">林地面积</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.forestArea }}
        </div>
      </div>
      <div class="k-resp-zone-item">
        <div class="k-zone-item-box k-reap-1">省级公益林</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.provincePublicWelfareForestArea }}
        </div>
        <div class="k-zone-item-box k-reap-3">市级公益林</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.cityPublicWelfareForestArea }}
        </div>
      </div>
      <div class="k-resp-zone-item">
        <div class="k-zone-item-box k-reap-1">湿地面积</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.wetLandArea }}
        </div>
        <div class="k-zone-item-box k-reap-3">保护地面积</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.responseArea.wetLandProtectArea }}
        </div>
      </div>
      <div class="k-resp-zone-item">
        <div class="k-zone-item-box k-reap-1">林长数量</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.leaderNum }}
        </div>
        <div class="k-zone-item-box k-reap-3">护林员数量</div>
        <div class="k-zone-item-box k-reap-2">
          {{ PageDataRef.rangerNum }}
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { onMounted, ref } from "vue";
import { currectData, PageData, bus } from "../../composables/useMapView";
import tbg from "../../assets/images/tbg.svg";
const PageDataRef = ref(PageData.value);
onMounted(() => {
  bus.on((data) => {
    PageDataRef.value = data;
    // console.log(PageDataRef.value);
  });
});
</script>

<style scoped lang="scss">
.k-duty-box {
  position: relative;
  width: 380px;
  height: 26%;
  .k-title {
    position: relative;
    top: 12px;
    left: 12px;
    width: 378px;
    height: 36px;
    margin-bottom: 10px;

    .k-title-text {
      position: absolute;
      top: 6px;
      left: 11px;
      font-size: 16px;
      color: #fff;
      font-family: "HYk2gj";
      font-weight: bold;
    }
  }

  .k-resp-zone {
    position: relative;
    top: 12px;
    left: 12px;
    width: 395px;
    height: 178px;
    border: 1px solid #1de398;
    .k-resp-zone-item {
      position: relative;
      width: 100%;
      height: 34px;
      display: flex;
      flex-wrap: nowrap;
      flex-direction: row;
      justify-content: space-around;
      border-bottom: 1px solid rgba(122, 122, 122, 0.553);
      .k-zone-item-box {
        position: relative;
        height: 100%;
        width: 25%;
        text-align: center;
        line-height: 34px;
      }
      .k-reap-1 {
        background-color: #57ffb63d;
        border-right: 1px solid #1de398;
      }
      .k-reap-2 {
        color: #1de398;
      }
      .k-reap-3 {
        background-color: #57ffb63d;
      }
    }
  }
}
</style>
